<{include file="app/header.tpl"}>


<ul class="order-list-nav fix">
    <li class="li"><a href="/order/list/unfinished" <{if $type == 'unfinished' || $type == 'doing' || $type == ""}>class="active"<{/if}> title="">进行中</a></li>
    <li class="li"><a href="/order/list/finished" <{if $type == 'finished'}>class="active"<{/if}> title="">已完成</a></li>
    <li class="li"><a href="/order/list/cancelled" <{if $type == 'cancelled'}>class="active"<{/if}> title="">已取消</a></li>
</ul>

<{if $orders|@count > 0}>
<ul class="order-list-goods">
    <{foreach from=$orders item=order}>
    <li class="li">
        <a class="one fix" href="/davshop/detail/<{$order.shopId}>">
            <span class="left"><{$order.shopName}></span>
            <em class="middle"></em>
            <span class="right"><{$order.statusName}></span>
        </a>
        <a class="two fix" href="/order/detail/<{$order.orderNo}>" title="">
            <div class="left">
                <img class="img" src="<{$order.goods.thumb}>" alt="">
            </div>
            <div class="middle">
                <p class="goods-name"><{$order.goods.name}></p>
                <p class="yongjin">佣金￥<{$order.showMoney/100|number_format:2}></p>
            </div>
            <div class="right">
                <p class="money">￥<{$order.goods.money.money/100|number_format:2}></p>
                <p class="number">x <{$order.goods.money.quantity}></p>
            </div>
        </a>
        <p class="three fix">
            <span class="left">共<{$order.quantity}>件商品，合计：<span class="money">￥<{$order.moneyTotal/100|number_format:2}> <{if $order.moneyDeliver > 0}>(含运费: ￥<{$order.moneyDeliver/100|number_format:2}>)<{/if}></span></span>
            <{if $order.statusName == '未付款'}>

                <span class="oneBtns"><a href="" class="a" title=""><span onclick="order_show_item(this, '.oneBtns', '.twoBtns');return false;"  class="right">取消订单</span></a></span>
                <span class="hidden twoBtns">
                    <a href="" onclick="order_show_item(this, '.twoBtns', '.oneBtns');return false;"  class="a" title=""><span class="right">返回</span></a>
                    <a href="/order/remove/<{$order.orderNo}>" class="a" title=""><span class="right">删除</span></a>
                </span>

            <{elseif $order.statusName == '已付款'}>

                <a href="javascript:;" class="a" title=""><span class="right">等待收货</span></a>

            <{elseif $order.statusName == '已发货'}>

                <span class="oneBtns"><a href="" class="a" title=""><span onclick="order_show_item(this, '.oneBtns', '.twoBtns');return false;"  class="right">确认收货</span></a></span>
                <span class="hidden twoBtns">
                    <a href="" onclick="order_show_item(this, '.twoBtns', '.oneBtns');return false;"  class="a" title=""><span class="right">取消</span></a>
                    <a href="/order/finish/<{$order.orderNo}>" class="a" title=""><span class="right">确认</span></a>
                </span>

            <{elseif $order.statusName == '已完成'}>
                <{if $order.shaidan_id}>
                <a href="/show/detail/<{$order.shaidan_id}>"  class="a" title=""><span class="right">我的晒单</span></a>
                <{else}>
                <a href="" onclick="user_create_show(<{$global_user.userUid}>, '<{$order.orderId}>', '<{$order.orderNo}>');return false;"  class="a" title=""><span class="right">我要晒单</span></a>
                <{/if}>
                
                <{if $order.is_pinglun}>
                <a href="/order/evaluation/<{$order.orderNo}>"  class="a" title=""><span class="right">我的评价</span></a>
                <{else}>
                <a href="/order/evaluation/<{$order.orderNo}>"  class="a" title=""><span class="right">我要评价</span></a>
                <{/if}>
            <{/if}>
        </p>
    </li>
    <{/foreach}>
</ul>
<{else}>
<div class="order-list-null">
    <img src="/resource/app/imgs/all_empty.png" class="img" alt="">
    <p class="text">暂无订单</p>
</div>
<{/if}>

<script>
function order_show_item(item, itemHide, itemShow)
{
    var p = item.parentNode;
    while (! $(p).hasClass('three'))
    {
        p = p.parentNode;
    }

    $(p).find(itemHide).hide();
    $(p).find(itemShow).show();
}
</script>

<{include file="app/footer.tpl"}>
